package com.robot.dao.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.robot.dao.entity.Prologue;
import lombok.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CreateRobotResultDTO implements Serializable{
    @JsonProperty("robot_name")
    private String robotName;
    @JsonProperty("robot_description")
    private String robotDescription;
    @JsonProperty("character_design")
    private String characterDesign;

    private String prologue;
    private Integer isValid;
    @JsonProperty("question_lead")
    private List<String> questionLead;
    private List<String> knowledgeList;

    @JsonProperty("prompt_template")
    private List<PromptTemplate> prompt_template;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    public static class PromptTemplate implements Serializable {
        private String type; // optional--n选1，可选项为content；slot--普通文本，对应提示词为
        private String title;
        private String placeholder;
        private List<String> content;
        private Boolean is_required;
        public List<String> getContent() {
            if (content==null){
                return new ArrayList<String>();
            }
            return content;
        }

        public Boolean getIs_required(){
            if (is_required==null){
                return false;
            }
            return is_required;
        }

    }
}
